package projectmanagement.managementtool.MeetingServices;

import projectmanagement.models.Meeting;
import projectmanagement.models.User;
import projectmanagement.models.Project;

import java.util.Calendar;
import java.util.List;

/**
 * MeetingService interface specifies essential methods for
 * meeting-handling.
 *
 * @author Valera Rusakov
 */
public interface MeetingService {
    /**
     * Tries to create new meeting and add it to specified project
     *
     * @param description      string description of the meeting
     * @param meetingStartTime start time of the meeting in format (dd/mm/yyyy hh:mm)
     * @param meetingDuration  duration of the meeting in format (hh:mm)
     * @param project          instance of project for meeting to be added
     * @return Meeting instance if meeting was created, null if project instance not found
     *         or validation was failed
     */
    Meeting createMeeting(String description, Calendar meetingStartTime, Calendar meetingDuration, Project project);

    /**
     * @param description      new string description
     * @param meetingStartTime new start time of the meeting in format (dd/mm/yyyy hh:mm)
     * @param meeting          instance of Meeting which will be edited
     * @return Edited version of the meeting
     */
    Meeting editMeeting(String description, Calendar meetingStartTime, Meeting meeting);

    /**
     * Assign users to the meeting
     *
     * @param list    list of users which will be assigned
     * @param meeting instance of meeting
     * @return True if assign is successful, otherwise - false
     */
    boolean assignUsersOnMeeting(List list, Meeting meeting);

    /**
     * Assign user on meeting
     *
     * @param user instance of user
     * @param meet instance of meeting
     * @return True if assign is successful, otherwise - false
     */
    boolean assignUserOnMeeting(User user, Meeting meet);

    /**
     * Show the details of the meeting
     *
     * @param meet instance of the meeting
     * @return String representation of the meeting object
     */
    String getMeetingDetails(Meeting meet);

    /**
     * Validate the time of the meeting start
     *
     * @param meetingStartTime instance of Calendar in format (dd/mm/yyyy hh:mm)
     * @return True if meeting start time after current system time, else - false
     */
    boolean isValidTime(Calendar meetingStartTime);

    /**
     * Search and returns the meeting by id
     *
     * @param project instance of project, expected to be not null
     * @param id      id of the meeting, which is searching
     * @return Meeting instance is search successful, otherwise - null
     */
    Meeting getMeetingById(Project project, int id);
}
